#include "stdafx.h"
#include "http_server.h"
#include "http_service.h"
#include "http_servlet.h"
#include "http_client.h"

http_client::http_client(http_server& server, acl::socket_stream& conn)
: server_(server)
, conn_(conn)
{
}

void http_client::start() {
    acl::memcache_session session("127.0.0.1:11211");
    http_servlet servlet(server_.get_service(), &conn_, &session);

    // charset: big5, gb2312, gb18030, gbk, utf-8
    servlet.setLocalCharset("utf-8");

    while(servlet.doRun()) {}
    //servlet.doRun();
}
